<?php

class MY_Controller extends CI_Controller {

    public function __construct() {
        parent::__construct();

        //$this->output->enable_profiler(TRUE);
    }

    public function is_logged_in() {

        $logged_in = $this->session->userdata('user_id');
        return $logged_in;
    }

}

class Member_Controller extends MY_Controller {

    var $user_id = NULL;

    function __construct() {
        parent::__construct();

        //Initialization code that affects Member controllers. I.E. redirect and die if not logged in
        if (!$this->is_logged_in()) {
            redirect('main/not_log_in');
        } else {
            $this->user_id = $this->is_logged_in();
        }
    }

}

/* End of file MY_Controller.php */
/* Location: ./application/controllers/MY_Controller.php */

